package net.sureon.biz;

import java.util.Date;
import java.util.List;

import net.sureon.dao.DailyTiming;
import net.sureon.dao.DailyTimingDAO;
import net.sureon.dao.DailyTimingStatistic;

public class DailyTimingMgrImpl implements DailyTimingMgr {

	private DailyTimingDAO dailyTimingDAO;

	public void deleteDailyTiming(long companyID, long dailyTimingID) {
		dailyTimingDAO.deleteDailyTiming(companyID, dailyTimingID);
	}

	public DailyTiming getDailyTimingByID(long companyID, long dailyTimingID) {
		return dailyTimingDAO.getDailyTimingByID(companyID, dailyTimingID);
	}

	public long insertDailyTiming(DailyTimingBO dailyTiming) {
		return dailyTimingDAO.insertDailyTiming(dailyTiming.getDailyTimingVO());
	}

	public int updateDailyTiming(long companyID, long dailyTimingID,
			java.util.Date reviewDate, long reviewedBy, String reviewNote,
			String status) {
		return dailyTimingDAO.updateDailyTiming(companyID, dailyTimingID,
				reviewDate, reviewedBy, reviewNote, status);
	}

	/**
	 * 用户未审核的申请(Pending)
	 */
	public List<DailyTiming> getDailyTimingByUserNotReview(long companyID,
			long userID, int skipResults, int maxResults) {
		return dailyTimingDAO.getDailyTimingByUserNotReview(companyID, userID, skipResults, maxResults);
	}

	/**
	 * 用户审核过的申请（包括审核不通过和审核通过/NotApproved,Approved）
	 */
	public List<DailyTiming> getDailyTimingByUserReview(long companyID,
			long userID, int skipResults, int maxResults) {
		return dailyTimingDAO.getDailyTimingByUserReview(companyID, userID, skipResults, maxResults);
	}

	/**
	 * 未审核的下属申请(Pending)
	 */

	public List<DailyTiming> getDailyTimingByGroupNotReview(long companyID,
			List<Long> idsAsList, int skipResults, int maxResults) {
		return dailyTimingDAO.getDailyTimingByGroupNotReview(companyID,
				idsAsList, skipResults, maxResults);
	}

	/**
	 * 审核过的下属申请（包括 NotApproved和Approved）
	 */

	public List<DailyTiming> getDailyTimingByGroupReview(long companyID,
			List<Long> idsAsList, int skipResults, int maxResults) {
		return dailyTimingDAO.getDailyTimingByGroupReview(companyID, idsAsList, skipResults, maxResults);
	}

	public DailyTimingDAO getDailyTimingDAO() {
		return dailyTimingDAO;
	}

	public void setDailyTimingDAO(DailyTimingDAO dailyTimingDAO) {
		this.dailyTimingDAO = dailyTimingDAO;
	}

	public List<DailyTimingStatistic> getDailyTimingStatisticInfo(
			long companyID, long userID) {
		return dailyTimingDAO.getDailyTimingStatisticInfo(companyID, userID);
	}

	public List<DailyTimingStatistic> getDailyTimingStatisticInfoByGroup(
			long companyID, List<Long> idsAsList) {
		return dailyTimingDAO.getDailyTimingStatisticInfoByGroup(companyID,
				idsAsList);
	}

	public List<DailyTimingStatistic> getDailyTimingStatisticInfoByGroup(
			long companyID, List<Long> idsAsList, Date startDate, Date endDate) {
		return dailyTimingDAO.getDailyTimingStatisticInfoByGroup(companyID, idsAsList, startDate, endDate);
	}

	public DailyTiming getDailyTimingByWorkDate(long companyID, long userID,
			java.util.Date workDate) {
		return dailyTimingDAO.getDailyTimingByWorkDate(companyID, userID,
				workDate);
	}

	public int editDailyTiming(long companyID, long dailyTimingID,
			float workTime, float overTime, float vocationTime,
			float leaveTime, String workSummary, java.util.Date submitDate,
			String status) {
		return dailyTimingDAO.editDailyTiming(companyID, dailyTimingID,
				workTime, overTime, vocationTime, leaveTime, workSummary,
				submitDate, status);
	}

}
